package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.Objects;

@Entity
public class Orderinvoice {
    private int oderinId;//id
    private String oderinNumber;//发票号码
    private Integer oderinOrderid;//合同
    private String oderinInfo;//开票内容
    private Date oderidData;//开票日期
    private String oderidType;//开票类型
    private Integer oderidUderid;//开票人id
    private String irmask;//备注
    private Orderdetails orderdetailsByOdetailsId;//订单详情

    private Integer odetailsId;//订单
    private BigDecimal invAmount;//开票金额
    private Integer invCustomerid;//客户id
    private Integer invApproverid;
    private Integer invAppstate;

    @Id
    @Column(name = "oderin_id")
    public int getOderinId() {
        return oderinId;
    }

    public void setOderinId(int oderinId) {
        this.oderinId = oderinId;
    }

    @Basic
    @Column(name = "oderin_number")
    public String getOderinNumber() {
        return oderinNumber;
    }

    public void setOderinNumber(String oderinNumber) {
        this.oderinNumber = oderinNumber;
    }

    @Basic
    @Column(name = "oderin_orderid")
    public Integer getOderinOrderid() {
        return oderinOrderid;
    }

    public void setOderinOrderid(Integer oderinOrderid) {
        this.oderinOrderid = oderinOrderid;
    }

    @Basic
    @Column(name = "oderin_info")
    public String getOderinInfo() {
        return oderinInfo;
    }

    public void setOderinInfo(String oderinInfo) {
        this.oderinInfo = oderinInfo;
    }

    @Basic
    @Column(name = "oderid_data")
    public Date getOderidData() {
        return oderidData;
    }

    public void setOderidData(Date oderidData) {
        this.oderidData = oderidData;
    }

    @Basic
    @Column(name = "oderid_type")
    public String getOderidType() {
        return oderidType;
    }

    public void setOderidType(String oderidType) {
        this.oderidType = oderidType;
    }

    @Basic
    @Column(name = "oderid_uderid")
    public Integer getOderidUderid() {
        return oderidUderid;
    }

    public void setOderidUderid(Integer oderidUderid) {
        this.oderidUderid = oderidUderid;
    }

    @Basic
    @Column(name = "Irmask")
    public String getIrmask() {
        return irmask;
    }

    public void setIrmask(String irmask) {
        this.irmask = irmask;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Orderinvoice that = (Orderinvoice) o;
        return oderinId == that.oderinId &&
                Objects.equals(oderinNumber, that.oderinNumber) &&
                Objects.equals(oderinOrderid, that.oderinOrderid) &&
                Objects.equals(oderinInfo, that.oderinInfo) &&
                Objects.equals(oderidData, that.oderidData) &&
                Objects.equals(oderidType, that.oderidType) &&
                Objects.equals(oderidUderid, that.oderidUderid) &&
                Objects.equals(irmask, that.irmask);
    }

    @Override
    public int hashCode() {
        return Objects.hash(oderinId, oderinNumber, oderinOrderid, oderinInfo, oderidData, oderidType, oderidUderid, irmask);
    }

    /*@ManyToOne
    @JoinColumn(name = "odetails_id", referencedColumnName = "odetails_id")
    public Orderdetails getOrderdetailsByOdetailsId() {
        return orderdetailsByOdetailsId;
    }

    public void setOrderdetailsByOdetailsId(Orderdetails orderdetailsByOdetailsId) {
        this.orderdetailsByOdetailsId = orderdetailsByOdetailsId;
    }*/

    @Basic
    @Column(name = "inv_amount")
    public BigDecimal getInvAmount() {
        return invAmount;
    }

    public void setInvAmount(BigDecimal invAmount) {
        this.invAmount = invAmount;
    }

    @Basic
    @Column(name = "inv_customerid")
    public Integer getInvCustomerid() {
        return invCustomerid;
    }

    public void setInvCustomerid(Integer invCustomerid) {
        this.invCustomerid = invCustomerid;
    }

    @Basic
    @Column(name = "odetails_id")
    public Integer getOdetailsId() {
        return odetailsId;
    }

    public void setOdetailsId(Integer odetailsId) {
        this.odetailsId = odetailsId;
    }

    @Basic
    @Column(name = "inv_approverid")
    public Integer getInvApproverid() {
        return invApproverid;
    }

    public void setInvApproverid(Integer invApproverid) {
        this.invApproverid = invApproverid;
    }

    @Basic
    @Column(name = "inv_appstate")
    public Integer getInvAppstate() {
        return invAppstate;
    }

    public void setInvAppstate(Integer invAppstate) {
        this.invAppstate = invAppstate;
    }
}
